feat: add main-repo worktree mode for topics#3
Merged
ByteMirror merged 15 commits intomainfrom Feb 23, 2026
Merged
Conversation
The handleDefaultKeys function returns early for any key not in GlobalKeyStringsMap, making the previous default-case A check dead code. Add KeyAutomations constant, register "A" in the map, and use a proper case in the switch.
Replace the consecutive text-input modal chain (name → instructions → schedule) with a single AutomationForm that shows all three fields at once inside the automations modal. Tab/Shift+Tab moves between fields, Ctrl+S saves, Esc cancels. Also adds edit support: press 'e' on a selected automation to open the same form pre-populated. Toggle is now 't' to free up 'e' for edit.
Introduces TopicWorktreeMode string enum (per_instance, shared, main_repo) on Topic, with IsSharedWorktree/IsMainRepo helpers and a default of per_instance in NewTopic. Updates topic_storage.go to serialise WorktreeMode and migrate legacy SharedWorktree bool on read.
a1f3a6c to
bd99679
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SharedWorktree boolonTopicwith aTopicWorktreeModestring enum (per_instance,shared,main_repo)What changed
session/topic.goTopicWorktreeModeenum +IsSharedWorktree()/IsMainRepo()helperssession/topic_storage.goworktree_modeJSON field; legacyshared_worktreebool is auto-migrated on readsession/instance.gomainRepo boolfield +GetWorkingPath()(returns worktree path or repo path)session/instance_lifecycle.goStartInMainRepo()method;Pause()/Resume()guarded against nil worktreeapp/app_input.goConfirmationOverlay→PickerOverlaywith 3 options; MainRepo dispatch branchapp/app_state.goGetGitWorktree()callers replaced withGetWorkingPath()app/app_brain.goapp/app.gostateNewTopicConfirmnow renderspickerOverlay(notconfirmationOverlay)UX
When creating a topic (
T), instead of a Y/N dialog the user sees:Backward compatibility
Existing topics stored with
"shared_worktree": true/falseare automatically migrated to the new enum on first read. No manual migration required.Test plan
worktree_modein JSON) load correctly as per-instance or shared